package com.gcong.controller;

import com.gcong.model.Person;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * Created by 巩聪 on 2018/1/7.
 */
@RestController
@RequestMapping(value = "hello")
public class HelloController {
    @RequestMapping(value = "sayHello", method = RequestMethod.GET)
    public String sayHello() {
        return "hello";
    }
    @GetMapping(value = "sayHi/{name}")
    public String sayHi(@PathVariable(value = "name") String hiName, @RequestParam(value = "age",required = false,defaultValue = "28") int age)
    {
        return "hi:"+hiName+":"+age;
    }
}
